package cate.game.play.proce.action.po;

import cate.game.play.proce.result.ActionResult;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

import java.util.ArrayList;
import java.util.List;

@NoteClass("基础行动数据")
public abstract class ActionPO {

	@NoteField("行动者pid")
	public int actorPid;

	@NoteField("行动者行为类型")
	public byte type;

	@NoteField("行动结果")
	public List<ActionResult> results;

	@NoteField("播放时长")
	@JsonInclude(JsonInclude.Include.NON_NULL)
	public Integer playTime;

	/** 追加结果 */
	public void addResult(ActionResult result) {
		if (this.results == null) {
			this.results = new ArrayList<>();
		}
		this.results.add(result);
	}

	@JsonIgnore
	public boolean isEmpty() {
		return false;
	}
}
